package Controller;

import java.util.List;

import bean.TestCase;

import recom.Recommendation;
import View.MainView;

public class MainController {
	private MainView mv = null;
	private Recommendation rec = null;
	private List<Integer> resultList = null;
	
	public static void main(String[] args) {
		MainController mc = new MainController();
		mc.start();
	}
	
	public void start() {
		mv = new MainView(this);
	}
	
	public void readData(String file) {
		rec = new Recommendation(this);
		boolean success = rec.setArffFile(file);
		if(success) {
			Thread thread = new Thread(rec);
			thread.start();
		}else {
			System.out.print("File not exist");
		}
	}
	
	public void showRecommendTestCase(List<TestCase> testcaseList) {
		mv.refleshRecomendationTable(testcaseList);
	}
	
	public void setResultsOfTestCases(List<Integer> resultList) {
		this.resultList = resultList;
		rec.setCanGoOn(true);
	}
	
	public List<Integer> getResultsOfTestCases() {
		return resultList;
	}
}
